package com.lagou.cl.serializer;

import com.alibaba.fastjson.JSON;

/**
 * @author 程  林
 * @date 2020-05-24 17:10
 * @description // 自定义JSON序列化接口
 * @since V1.0.0
 */
public class JSONSerializer implements Serializer {


	@Override

	public byte[] serialize(Object object) {

		return JSON.toJSONBytes(object);

	}


	@Override

	public <T> T deserialize(Class<T> clazz, byte[] bytes) {

		return JSON.parseObject(bytes, clazz);

	}

}